<?php
	function getCmisId($fileName) {
		$fileName = basename($fileName);
		$content = file_get_contents("http://admin:admin@192.168.1.87:8080/alfresco/s/cmis/query?q=SELECT%20cmis:objectId%20FROM%20CMIS:DOCUMENT%20WHERE%20CMIS:NAME%20='" . $fileName . "'&searchAllVersions=false&maxItems=100&skipCount=0&includeAllowableActions=false&includeRelationships=false");

		return doTransform($content,'cmis.xsl');
	}
function doTransform($xml, $xsl, $params = array()) {
	$xmlObj = new DomDocument();
	$xmlObj->resolveExternals = true;     
	if (is_file($xml)) {
		$xmlObj->load($xml);
	} else {
		$xmlObj->loadXML($xml);
	}
	$xslt = new xsltProcessor();
	$xslt->importStyleSheet(DomDocument::load($xsl));
	$xslt->registerPHPFunctions();
	//$xslt->setParameter('', 'path',  $path);
	$content = $xslt->transformToXML($xmlObj);
	return $content;
}

echo str_replace("&#10;","",doTransform('DITA-OT/samples/hierarchy.ditamap','cmissearch.xsl'));
?>
